#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int main() {
	FILE* pf = fopen("data.txt", "r");
	if (pf == NULL) {
		perror("fopen");
		return 1;
	}
	FILE* pfout = fopen("data_copy.txt", "w");
	if (pfout == NULL) {
		fclose(pf);
		perror("fopen");
		return 1;
	}
	char ch = 0;
	while ((ch = fgetc(pf)) != EOF) {
		fputc(ch, pfout);
	}
	fclose(pf);
	pf = NULL;
	fclose(pfout);
	pfout = NULL;
	return 0;
}
